package com.taotao.controller;

import com.taotao.common.pojo.EUTreeNode;
import com.taotao.service.TbItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by marui on 2017/6/21.
 * 商品分类管理controller
 */
@Controller
@RequestMapping("/item/cat")
public class TbItemCatController {

	@Autowired
	private TbItemCatService tbItemCatService;

	@RequestMapping("/list")
	@ResponseBody
	public List<EUTreeNode> getItemCatList(@RequestParam(value = "id", defaultValue = "0") Long parentId) {
		return tbItemCatService.getCatList(parentId);
	}

}
